import request from '../utils/fetch'


/**
 * 积分订单管理
 * @param {current:页码,size:数量,orderStatus:订单状态,startTime:开始时间,endTime:结束时间,studentId:学生id} data
 */
export function orderList (data) {
    return request({
        url: '/admin/integral/getIntegralOrdersList',
        method: 'get',
        loading: false,
        params: data
    })
}
/**
 * 积分订单详情
 * @param {orderId:订单id} data
 */
export function orderInfo (data) {
    return request({
        url: '/admin/integral/getIntegralOrdersInfo',
        method: 'get',
        loading: true,
        params: data
    })
}
/**
 * 修改订单状态
 * @param {expressId:物流公司id,expressName:物流公司名称,expressNo:快递单号,orderId:订单id} data
 */
export function orderShip (data) {
    return request({
        url: '/admin/integral/changeIntegralOrdersState',
        method: 'get',
        loading: true,
        params: data
    })
}


/**
 * 积分订单完成
 * @param {orderId:订单id} data
 */
export function orderFinish (data) {
    return request({
        url: '/admin/integral/order/finish',
        method: 'post',
        loading: true,
        data: data
    })
}


/**
 * 积分商品列表
 * @param {current:页码,size:数量,goodsName:商品名称} data
 */
export function goodsList (data) {
    return request({
        url: '/admin/integral/getIntegralGoodsList',
        method: 'get',
        loading: false,
        params: data
    })
}
/**
 * 新增积分商品
 */
export function goodsAdd (data) {
    return request({
        url: '/admin/integral/addIntegralGoods',
        method: 'get',
		requestBody: 'body',
        loading: true,
        params: data
    })
}


/**
 * 修改积分商品
 */
export function goodsEdit (data) {
    return request({
        url: '/admin/integral/goods/edit',
        method: 'get',
		requestBody: 'body',
        loading: true,
        params: data
    })
}
/**
 * 积分商品详情
 */
export function goodsInfo (data) {
    return request({
        url: '/admin/integral/goods/info',
        method: 'get',
        loading: true,
        params: data
    })
}

/**
 * 积分商品状态修改
 */
export function shangpinstatus (data) {
    return request({
        url: '/admin/integral/goods/status',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}


/**
 * 新增积分商品采购单
 */
export function addcaigou (data) {
    return request({
        url: '/admin/integral/addIntegralGoodsPurchase',
        method: 'get',
		requestBody: 'body',
        loading: true,
        params: data
    })
}
/**
 * 获取积分商品采购单列表
 */
export function caigoulist (data) {
    return request({
        url: '/admin/integral/getIntegralGoodsPurchaseList',
        method: 'get',
        loading: true,
        params: data
    })
}

/**
 * 启用积分商品采购单
 */
export function enablecaigou (data) {
    return request({
        url: '/admin/integral/openIntegralGoodsPurchase',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}
/**
 * 修改积分商品采购单
 */
export function updatecaigou (data) {
    return request({
        url: '/admin/integral/updateIntegralGoodsPurchase',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}
/**
 * 反馈总数量
 */
export function fanhuixianshi (data) {
    return request({
        url: '/admin/integral/statisticData',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}
/**
 * 获取商品列表
 */
export function huoqushangpinlist (data) {
    return request({
        url: '/admin/integral/goods/list',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}
export function huoqushangpinlist1 (data) {
    return request({
        url: '/api/integral/goods/list1',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}

/**
 * 删除商品列表
 */
export function delcaigou (data) {
    return request({
        url: '/admin/integral/delIntegralGoodsPurchase',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}


/**
 * 获取库存列表
 */
export function kucunlist (data) {
    return request({
        url: '/admin/integral/getIntegralGoodsStockList',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}

/**
 * 获取积分商品列表
 */
export function jifenshangpinlist (data) {
    return request({
        url: '/admin/integral/getIntegralGoodsList',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}

/**
 * 获取积分商品列详情
 */
export function jifengoodslist (data) {
    return request({
        url: '/admin/integral/getIntegralGoodsInfo',
        method: 'get',
        loading: true,
		requestBody: 'query',
        params: data
    })
}

//下载出库单

export function xiazai (data) {
    return request({
      url: '/admin/integral/downloadBackOrder',
      method: 'get',
      requestBody: 'null',
      loading: true,
      ContentType: 'application/x-download',
      params: data
    })
  }



